<template>
  <div class="app-container">
    <div class="operation">
      <el-row :gutter="20">
        <el-col :span="4.9">
          <div class="grid-content bg-purple">
            <label>项目服务名称</label>
            <el-input
              placeholder="请输入内容"
              style="width: fit-content"
              v-model="project.name"
              clearable>
            </el-input>
          </div>
        </el-col>
        <el-col :span="4.9">
            <div class="grid-content bg-purple">
              <label>项目服务价格</label>
              <el-input
                placeholder="请输入内容"
                style="width: fit-content"
                v-model="project.price"
                clearable>
              </el-input>
            </div>
        </el-col>
        <el-col :span="4.8">
          <div class="grid-content bg-purple">
              <label>备注</label>
              <el-input
                placeholder="请输入内容"
                style="width: fit-content"
                v-model="project.note"
                clearable>
              </el-input>
            </div>
        </el-col>
        <el-col :span="6">
          <div class="grid-content bg-purple">
            <el-button type="primary" icon="el-icon-search" @click="">搜索</el-button>
            <el-button type="primary" icon="el-icon-refresh">重置</el-button>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="1.3">
          <div class="grid-content bg-purple">
            <el-button type="primary" plain icon="el-icon-plus" @click="dialogVisible = true">新增</el-button>
          </div>
        </el-col>
        <el-dialog
          title="提示"
          :visible.sync="dialogVisible"
          width="30%"
          :before-close="handleClose">
          <el-form :model="form">
            <el-form-item label="添加项目名称" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="添加项目价格" :label-width="formLabelWidth">
              <el-input v-model="form.price" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="添加项目备注" :label-width="formLabelWidth">
              <el-input v-model="form.price" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  </span>
        </el-dialog>
        <el-col :span="1.3">
          <div class="grid-content bg-purple">
            <el-button type="success" plain icon="el-icon-edit" disabled>修改</el-button>
          </div>
        </el-col>
        <el-col :span="1.3">
          <div class="grid-content bg-purple">
            <el-button type="warning" plain icon="el-icon-delete" disabled>删除</el-button>
          </div>
        </el-col>
        <el-col :span="17">
          <div class="grid-content bg-purple">
            <el-button type="danger" plain icon="el-icon-download" @click="dialogVisible1=true">导出</el-button>
          </div>
        </el-col>
        <el-dialog
          title="提示"
          :visible.sync="dialogVisible1"
          width="30%"
          :before-close="handleClose">
          <span>您确定要删除此项吗?</span>
          <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible1 = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible1 = false">确 定</el-button>
          </span>
        </el-dialog>
        <el-col :span="1.3">
          <div class="grid-content bg-purple">
            <el-button icon="el-icon-search" circle></el-button>
          </div>
        </el-col>
        <el-col :span="1.3">
          <div class="grid-content bg-purple">
            <el-button icon="el-icon-refresh" circle></el-button>
          </div>
        </el-col>
      </el-row>
    </div>
    <div class="dashboard">
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
          type="selection"
          align="center"
          width="55">
        </el-table-column>
        <el-table-column
          prop="projectName"
          label="服务项目名称"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          prop="projectPrice"
          label="服务项目价格"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          prop="remark"
          align="center"
          label="备注">
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button
              size="mini"
              @click="handleEdit(scope.$index, scope.row)">编辑
            </el-button>
            <el-button
              size="mini"
              type="danger"
              @click="handleDelete(scope.$index, scope.row)">删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <br>
      <el-row :gutter="20">
        <el-col :span="22" :offset="14">
          <div class="grid-content bg-purple">
            <span>共9条</span>
            <el-select v-model="value" placeholder="10条/页">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            <el-button type="primary" icon="el-icon-arrow-left">上一页</el-button>
            <el-button type="primary">1</el-button>
            <el-button type="primary">下一页<i class="el-icon-arrow-right el-icon--right"></i></el-button>
            <span>&nbsp;&nbsp;前往&nbsp;&nbsp;&nbsp;<el-input style="width: 30px"
                                                            value="1">1</el-input>&nbsp;&nbsp;页</span>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "index.vue",
  data() {
    return {
      input: '',
      dialogVisible: false,
      dialogVisible1: false,
      project:
        {
          name: '',
          price: 199,
          note: '已付款',
        },
      tableData: [{
        projectName: '针灸',
        projectPrice: 99,
        remark: '已付款',
      }, {
        projectName: '针灸',
        projectPrice: 99,
        remark: '已付款',
      }, {
        projectName: '针灸',
        projectPrice: 99,
        remark: '已付款',
      }, {
        projectName: '针灸',
        projectPrice: 99,
        remark: '已付款',
      }, {
        projectName: '针灸',
        projectPrice: 99,
        remark: '已付款',
      }
      ],
      options: [{
        value: '选项1',
        label: '20条/页'
      }, {
        value: '选项2',
        label: '30条/页'
      }, {
        value: '选项3',
        label: '40条/页'
      }],
      form:
        {
          name: '',
          price: '',
          note: ''
        },
      methods:
        {
          handleEdit(index, row) {
            console.log(index, row);
          },
          handleDelete(index, row) {
            console.log(index, row);
          }
        }
    }

  }
}
</script>

<style scoped>
.el-row {
  margin-bottom: 20px;

&
:last-child {
  margin-bottom: 0;
}

}
.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #ffffff;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}

label {
  display: inline-block;
  float: left;
  font-family: sans-serif;
  height: auto;
  line-height: 36px;
  padding-right: 5px;
  padding-left: 5px;
}


</style>
